﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage.Streams;

using Windows.Storage;

namespace DigitalPublisher
{
    class Base64
    {
        IReadOnlyList<StorageFile> files;
        public string base64 = "";
        public async void GetBtyeFromFile(StorageFile storageFile)
        {
            var stream = await storageFile.OpenReadAsync();

            using (var dataReader = new DataReader(stream))
            {
                var bytes = new byte[stream.Size];
                await dataReader.LoadAsync((uint)stream.Size);
                dataReader.ReadBytes(bytes);

                base64 = Convert.ToBase64String(bytes);
            }
        }
    }
}
